package main

import (
	"context"
	"fmt"
	"google.golang.org/grpc"
	"service_base_shop/user_srv/Proto"
)


func main()  {
	conn,err:=grpc.Dial("127.0.0.1:8081",grpc.WithInsecure())
	if err!=nil {
		fmt.Println("连接服务器失败",err)
	}
	defer conn.Close() //获得grpc句柄 c:=pt.NewHelloServerClient(conn)
	c := protopb.NewUserClient(conn)
	fmt.Println(c)
	res,err := c.GetUser(context.Background(),&protopb.UserRequest{Id: 3})

	fmt.Println(res.Id,err)

}
